# 设置最低版本要求
cmake_minimum_required(VERSION 3.10)

# 项目名称和语言
project(FEM_TEST LANGUAGES CXX)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 指定包含路径
include_directories(include)

# 查找 MPI 包
# find_package(MPI REQUIRED)
# 查找 OpenMP 包
find_package(OpenMP REQUIRED)

# 添加 MPI 头文件路径
#include_directories(SYSTEM ${MPI_INCLUDE_PATH})

include_directories(${VTUNE_INCLUDE_DIR})
# link_directories(${VTUNE_LIBRARY_DIR})

# 源文件列表
set(SRC_FILES
    # src/NonUniSearch_KNN.cpp
    # src/UniSearch_eqDis.cpp
    src/UniSearch_uneqDis.cpp
)

# 生成可执行文件
add_executable(test ${SRC_FILES})

# 链接 MPI 和 OpenMP 库
target_link_libraries(test PUBLIC OpenMP::OpenMP_CXX)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(test PRIVATE /RTC1 /Od ${OpenMP_CXX_FLAGS})
elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
    target_compile_options(test PRIVATE /O2 ${OpenMP_CXX_FLAGS})
endif()

# 设置可执行文件输出路径
set_target_properties(test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
